﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Alphacat.Model
{
    public enum FileTaskType
    {
        File, Image, Text
    }

    class FileTask
    {
        public string Url;
        public string FileName;
        public string FromUserID;
        public string MyUserID;
        public string RealFileName;

        public byte[] fileData = null;
        public string code = null;
        public byte[] codeImgData = null;

        public DateTime time;

        public int receRetryTime = 0;
        public int sendRetryTime = 0;

        public FileTaskType msgType = FileTaskType.File;
        public string msgText = null;

        public FileTask(string url,
                        string fileName,
                        string fromUserID,
                        string myUserID,
                        string realFileName)
        {
            Url = url;
            FileName = fileName;
            FromUserID = fromUserID;
            MyUserID = myUserID;
            RealFileName = realFileName;

            time = DateTime.Now;
        }

        public FileTask(string text, string fromUserID, string myUserID)
        {
            msgText = text;
            msgType = FileTaskType.Text;
            FromUserID = fromUserID;
            MyUserID = myUserID;
        }
    }
}
